﻿CREATE PROCEDURE [dbo].[kp_GiayToKemTheoSelect]
	@Ma_DoiTuong nvarchar(10),
	@Loai_DoiTuong int
AS
	SELECT T1.Ma_LoaiGt,
			T2.Ten_LoaiGt,
			ISNULL(T1.Ghi_Chu,t2.Ghi_Chu) Ghi_Chu
	FROM
			[tblGiayToKemTheo] T1 INNER JOIN [tblDmLoaiGt] T2
			ON T1.Ma_LoaiGt=T2.Ma_LoaiGt
	WHERE T1.Ma_DoiTuong = @Ma_DoiTuong AND T1.Loai_DoiTuong=@Loai_DoiTuong
	Order By Vi_Tri
			
RETURN 0;